package hh.util.bean.copy;

import hh.util.bean.ClassInfo;
import hh.util.bean.ReflectFieldInfo;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author huanghuai
 * @date 2020/10/26
 */
public class GetAndSetCodeGenCopier extends GetSetCopier {
    private static final long serialVersionUID = -3441487741431485807L;
    static final AtomicInteger index = new AtomicInteger(0);


    @Override
    protected <Source, Dest> void doReflectFieldCopy(ReflectFieldInfo sourceFieldInfo, ReflectFieldInfo destFieldInfo, Source source, Dest destObj) throws Exception {
        // destFieldInfo.invokeCodeGenSet(destObj, sourceFieldInfo.invokeCodeGenGet(source));
    }

    @Override
    protected void doInitClassInfo(ClassInfo classInfo) {
        ReflectFieldInfo[] fieldInfos = classInfo.getFieldInfos();
        for (ReflectFieldInfo fieldInfo : fieldInfos) {
            // fieldInfo.setCodeGenGetAndSet(GetAndSetFactory.getObject(fieldInfo.getField()));
        }
    }

}
